<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>详情</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no">
	<c:set var="ctx" value="${pageContext.request.contextPath}" />
    <link rel="stylesheet" href="${ctx}/assets/css/amazeui.min.css">
    <link rel="stylesheet" href="${ctx}/assets/css/style.css?v=2.3">
    <link rel="stylesheet" href="${ctx}/assets/css/index.css?v=2.3">
</head>
<body class="bg-white">
<header data-am-widget="header" class="am-header am-header-default am-header-fixed am-border-bottom">
    <div class="am-header-left am-header-nav">
        <a onclick="history.go(-1)"> <i class="icon_8"></i>
        </a>
    </div>
    <h1 class="am-header-title">
        详情
    </h1>

</header>
<section class="am-padding-bottom-sm" id="amz-main" data-tag="css-nav">


    <div class="bg-white">
        <!--咨询介绍-->
        <div class=" am-padding-bottom-sm ">
            <div class="report_item bg-gray am-margin-left-sm am-margin-right-sm  ">
                <div class="am-g   am-padding-top-sm   am-padding-bottom-sm">
                    <div class=" am-u-sm-12 am-list-main font-color-13 box prelative">
                        <i class="icon_12"></i>

                        <div class="width-50px">
                            <div class="icon_9-1"></div>

                        </div>
                        <div class="box-1">
                            <div class="am-list-item-hd font-color-13 am-padding-top-sm am-text-truncate">
            <c:if test="${study.studyType==1}">
            集训购买：${study.studyTitle}
            </c:if>                    
           <c:if test="${study.studyType==2}">
            培训购买：${study.studyTitle}
            </c:if>
                            </div>
                            <div class="font-14  margin-top-9 ">
       <c:if test="${study.studyType==2}">培训</c:if><c:if test="${study.studyType==1}">集训</c:if>时间：${study.startStudyStr} 至 ${study.endStudyStr}
                            </div>
                            <div class="font-14   margin-top-9">
                                购买者：${order.customerName}
                            </div>
                            <div class="font-14   margin-top-9">
                                联系方式：${order.telephone}
                            </div>
                            <div class="font-14   margin-top-9">
                                总价：<span class="font-color-17">&yen;${order.orderPrice}</span>
                            </div>

                        </div>
                    </div>


                </div>
            </div>
        </div>
        <!--订单信息-->
        <div class="am-padding-left-lg am-padding-right-sm am-padding-bottom-sm">
            <div class="box font-color-13 am-margin-bottom-sm am-margin-top-xs">
                <div class="width-40px">
                    <div class="icon_10"></div>
                </div>
                <div class="box-1 padding-top-3px">
                    付款方式：微信支付
                </div>
            </div>
            <div class="box font-color-13 am-margin-bottom-sm">
                <div class="width-40px">
                    <div class="icon_68"></div>
                </div>
                <div class="box-1 padding-top-3px">
                    下单时间：${order.dateAddStr}
                </div>
            </div>
            <div class="box font-color-13 am-margin-bottom-sm">
                <div class="width-40px">
                    <div class="icon_69"></div>
                </div>
                <div class="box-1 padding-top-3px">
                    订单编号：${order.orderSn}
                </div>
            </div>
            <div class="box font-color-17">
                <div class="width-40px">
                    <div class="icon_70"></div>
                </div>
                <div class="box-1 padding-top-3px ">
                    总价：&yen;${order.orderPrice}
                </div>
            </div>
        </div>
    </div>

</section>
<footer data-am-widget="navbar" class="am-navbar am-cf am-navbar-default bg-white font-14"
        id="">
    <div class="  ">
        <div class="am-g am-text-center font-color-16  am-padding-bottom-xs ">
            <c:if test="${order.orderStatus==6}"><div class="am-u-sm-4 border-right jujue" data-id="${order.id}"><span class="prelative padding-left-15"><i class="icon_026_1"></i>拒绝报名</span></div>
            </c:if>
            <c:if test="${order.orderStatus==6}"><div class="am-u-sm-4 border-right"><span class="prelative padding-left-15"><i class="icon_027_1"></i><a href="tel:${order.telephone}" style="color:#9A9AAB">电联</a></span></div>
            </c:if>
            <c:if test="${order.orderStatus==6}"><div class="am-u-sm-4 jiesuan" data-id="${order.id}"><span class="prelative padding-left-15"><i class="icon_028_2"></i>同意报名</span></div>
        	</c:if>
        </div>
    </div>

</footer>

<div class="am-modal am-modal-prompt" tabindex="-1" id="my-prompt">
    <div class="am-modal-dialog">
        <div class="am-modal-hd">理由</div>
        <div class="am-modal-bd">
            <textarea rows="3" id="mark" class="mark_content am-modal-prompt-input" placeholder="请填写拒绝原因，拒绝后将自动退款"></textarea>
        </div>
        <div class="am-modal-footer">
            <span class="am-modal-btn" data-am-modal-cancel>取消</span>
            <span class="am-modal-btn" data-am-modal-confirm>确认</span>
        </div>
    </div>
</div>




<script src="${ctx}/assets/js/jquery.min.js"></script>
<script src="${ctx}/assets/js/amazeui.min.js"></script>
<script>
    $(function() {
        $('.jujue').on('click', function() {

            $('#my-prompt').modal({
                relatedTarget: this,
                onConfirm: function(options) {
                    var $link = $(this.relatedTarget);
                    var orderId=$link.data('id');
                    var mark=$("#mark").val();
					var orderStr=$.ajax({url:"${ctx}/updatePeixunOrder?mark="+mark+"&openType=0&orderId="+orderId,async:false});
		       	    var orderJson=JSON.parse(orderStr.responseText);
		       	    if(orderJson.resultCode=="0"){
		       	    	location.href="business/19.jsp?signBaomin=1&studyId=${study.id}";
		       	    }else{
		       	    	alert(orderJson.resultDesc);
		       	    }
                    
                },
                onCancel: function() {

                }
            });
        });
        $('.jiesuan').on('click', function() {
        
			var orderId=$(this).data('id');
			var orderStr=$.ajax({url:"${ctx}/updatePeixunOrder?openType=1&orderId="+orderId,async:false});
       	    var orderJson=JSON.parse(orderStr.responseText);
       	    if(orderJson.resultCode=="0"){
       	    	location.href="business/19.jsp?signBaomin=1&studyId=${study.id}";
       	    }else{
       	    	alert(orderJson.resultDesc);
       	    }
        });


    });
</script>
</body>
</html>